package com.mew.slots.core.game.sgj.room;


import com.mew.slots.core.common.game.BaseRoom;

import java.util.ArrayList;

public class SgjRoom extends BaseRoom {

    public static int _SCATTER = 9;//_WILD不允许替换

    public static int _JACKPOT=10;

    public static int _FREE = 8;

    public SgjRoom(){
        res = new PlayMsgs();
        row = 3;
        col = 5;
        _WILD = 9;
        spes = new ArrayList<Integer>(){{
            add(8);
            add(10);
        }};
        //香蕉 0  //西瓜1	//芒果2	//葡萄3	//菠萝4	//铃铛5	//樱桃6	//Bar7	//橙子8 //贝壳9    //scatter10
         rate = new int[][]{
                {0, 1,  3,   10, 75}, //香蕉
                {0, 0,  3,   10, 85}, //西瓜
                {0, 0, 15,  40,  250}, //芒果
                {0, 0, 25,  50,  400}, //葡萄
                {0, 0, 30,  70,  550}, //菠萝
                {0, 0,  35,  80,  650}, //铃铛
                {0, 0,  45,  100,   800}, //樱桃
                {0, 0,  75,  175,   1250}, //Bar
                {0, 0,  25,   50,   400},  //橙子
                {0, 0,  0,   0,   0},  //贝壳wild
                {0, 0,  100, 200,1750}  //Scatter
        };
        //小玛丽,断线回房间也要强制小玛丽
         alllines = new int[][]{
                {5,6,7,8,9},
                {0,1,2,3,4},
                {10,11,12,13,14},
                {0,6,12,8,4},
                {10,6,2,8,14},
                {0,1,7,13,14},
                {10,11,7,3,4},
                {5,1,7,13,9},
                {5,11,7,3,9}
        };
    }


    @Override
    public void freeBouns(){
        PlayMsgs res = (PlayMsgs) getRes();
        if (lxllx(_FREE)>2){
            res.setFree((byte) 1);
            res.setFreeNumber(10);
        }
        int xslx = xslx(_SCATTER);
        if (xslx==3){
            res.setBouns(1);
        }else if (xslx==4){
            res.setBouns(2);
        }else if (xslx==5){
            res.setBouns(3);
        }
        int jacklx = xslx(_JACKPOT);
        if (jacklx>2){
            res.setJp(1);
        }
    }
    @Override
    public int[] control(){
        switch (controlType) {
            case 1:
                return iliXml.getSpeints("21-23");
            case 2:
                return iliXml.getSpeints("free");
            case 3:
                return iliXml.getSpeints("marry");
            case 4:
                return iliXml.getSpeints("jp");
            default:
                return iliXml.getSpeints("0-0");
        }
    }

}
